﻿#ifndef __MainFrame__
#define __MainFrame__

#include "WxRoboCV_GUI.h"
#include "wx/dcclient.h"

const wxEventTypeTag<wxThreadEvent> wxEVT_THREAD_UPDATE(wxNewEventType());

class MainFrame : public MainFrame_base, public wxThreadHelper
{
public:
	// Constructor/destructor
	MainFrame(wxWindow* parent = nullptr);

private:
	// Private members
	wxCriticalSection	m_cs_image;
	wxImage				m_video_image;

	// Private functions
	wxThread::ExitCode	Entry();
	void				Render(wxDC &dc);

protected:
	// Event handlers
	void OnUpdateUI(wxUpdateUIEvent& event);
	void OnIdle(wxIdleEvent& event);
	void OnClose(wxCloseEvent& event);
	void OnMenuExit(wxCommandEvent& event);
	void OnCameraControls(wxCommandEvent& event);
	void OnThreadUpdate(wxThreadEvent& event);
	void OnCameraPanelPaint(wxPaintEvent& event);
	void OnCameraPanelSize(wxSizeEvent& event);
};

#endif // __MainFrame__
